<?php

function urlize($string) {
    return strtolower(Inflector::slug($string, '-'));
}

function array2json($array) {
    $ret = json_encode($array);
    return $ret;
}

function emptydir($path) {
    if ($dir = opendir($path)) {
        while ($f = readdir($dir)) {
            if (! preg_match('/^\.+$/', $f)) {
                @unlink($path . DS . $f);
            }
        }
    }
}
function currency_format($number) {
    return number_format($number, 2, ",", ".");
}
?>